Derivation of Efficient Logic Programs by Specialization and Reduction of Nondeterminism

نویسندگان

  • Alberto Pettorossi
  • Maurizio Proietti
  • Sophie Renault
چکیده

Program specialization is a program transformation methodology which improves program efficiency by exploiting the information about the input data which are available at compile time. We show that current techniques for program specialization based on partial evaluation do not perform well on nondeterministic logic programs. We then consider a set of transformation rules which extend the ones used for partial evaluation, and we propose a strategy for guiding the application of these extended rules so to derive very efficient specialized programs. The efficiency improvements which sometimes are exponential, are due to the reduction of nondeterminism and to the fact that the computations which are performed by the initial programs in different branches of the computation trees, are performed by the specialized programs within single branches. In order to reduce nondeterminism we also make use of mode information for guiding the unfolding process. To exemplify our technique, we show that we can automatically derive very efficient matching programs and parsers for regular languages. The derivations we have performed could not have been done by previously known partial evaluation techniques.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Specialization Technique for Deriving Deterministic Constraint Logic Programs and Its Application to Pattern Matching

When specializing programs one can increase efficiency by reducing nondeterminism. We consider constraint logic programs and we propose a technique which, by making use of a new transformation rule called clause splitting, allows us to generate efficient, specialized programs which are deterministic. We have applied our technique to the specialization of pattern matching programs.

متن کامل

The Transformational Approach to Program Development

We present an overview of the program transformation techniques which have been proposed over the past twenty-five years in the context of logic programming. We consider the approach based on rules and strategies. First, we present the transformation rules and we address the issue of their correctness. Then, we present the transformation strategies and, through some examples, we illustrate thei...

متن کامل

Efficient Delay Characterization Method to Obtain the Output Waveform of Logic Gates Considering Glitches

Accurate delay calculation of circuit gates is very important in timing analysis of digital circuits. Waveform shapes on the input ports of logic gates should be considered, in the characterization phase of delay calculation, to obtain accurate gate delay values. Glitches and their temporal effect on circuit gate delays should be taken into account for this purpose. However, the explosive numbe...

متن کامل

Nondeterminism Analysis of Functional Logic Programs

Information about the nondeterminism behavior of a functional logic program is important for various reasons. For instance, a nondeterministic choice in I/O operations results in a run-time error. Thus, it is desirable to ensure at compile time that a given program is not going to crash in this way. Furthermore, knowledge about nondeterminism can be exploited to optimize programs. In particular...

متن کامل

Specialization of Functional Logic Programs Based on Needed Narrowing Specialization of Functional Logic Programs Based on Needed Narrowing

Functional logic languages with a complete operational semantics are based on narrowing, a uniication-based goal-solving mechanism which subsumes the reduction principle of functional languages and the resolution principle of logic languages. Needed narrowing is an optimal narrowing strategy and the basis of several recent functional logic languages. In this paper, we deene a partial evaluator ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Higher-Order and Symbolic Computation

دوره 18  شماره 

صفحات  -

تاریخ انتشار 2005